<template>
  <div class=''>
        <ul class="con">
           <list v-for="(item,i) in list" :key="item.id" :item="item" :i="i" @del="del"/>
           <!-- <li v-for="(item,i) in list" :key="item.id" >
               <img :src="item.pic" alt="" @click="detail(item.id)">
               <h4>{{item.title}}</h4>
               <p @click="del(i)">删除</p>
            </li> -->
            
        </ul>
    </div>
</template>o23q

<script>
import list from "../components/List.vue"
export default {
    data() {
        return {
            list:[],
        };
    },
    mounted() {
         this.$axios.get("https://api.it120.cc/small4/cms/news/list").then((res)=>{
            // console.log(res);
             this.list=res.data.data
         })
    },
    methods: {
        del(i){
            this.list.splice(i,1)
        },
        detail(id){
            this.$router.push({path:"/Detail",query:{id:id}})
        },
    },
    components:{
        list
    }
};
</script>

<style lang='scss'>
 .con{
     display: flex;
     flex-wrap: wrap;
     justify-content: space-between;
     margin-bottom: 50px;
     
 }
</style>
